<template>
	<view class="yhqPop">
		<view class="popTit" @tap="closeYhq">
			<text>优惠券领取</text>
			<text class="iconfont icon-guanbi"></text>
		</view>
		<view class="popCon">
			<template v-if="hasYhqFlag">
				<!--  v-on="$listeners" -->
				<scroll-view class="scrollView" scroll-y>
					<yhq-list :hasYhqFlag="hasYhqFlag" :yhqList="yhqList" @yhqLq="yhqLq"></yhq-list>
					<view class="moreYhq" @tap="goMoreYhq" v-if="hasYhqFlag">更多优惠券</view>
				</scroll-view>
			</template>
			<template v-else-if="hasYhqFlag == false">
				<no-data style="margin:-40rpx 0 30rpx 0" noDataTxt="暂无优惠券"></no-data>
			</template>
		</view>
	</view>
</template>

<script>
	import YhqList from './YhqList.vue'
	export default {
		//inheritAttrs:false,
		props:{
			yhqList:Array,
			hasYhqFlag:Boolean
		},
		components:{
			YhqList
		},
		methods:{
			closeYhq(){
				this.$emit('closeYhq')
			},
			goMoreYhq(){
				this.$emit('goMoreYhq');
			},
			yhqLq(index,item){
				this.$emit('yhqLq',index,item);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.yhqPop{
		background: #F6F6F6;
		border-radius: 16rpx 16rpx 0 0;
		.popTit{
			height: 100rpx;
			line-height: 100rpx ;
			background: #FFF3DD;
			border-radius: 16rpx 16rpx 0 0;
			text-align: center;
			font-size: 32rpx;
			color: $pss-text-color3;
			position: relative;
			.icon-guanbi{
				position: absolute;
				right: 20rpx;
				top: 0rpx;
				color: $pss-text-color8;
				font-size: 36rpx;
			}
		}
		.popCon{
			padding: 20rpx;
		}
		.scrollView{
			max-height: 800rpx;
		}
		.moreYhq{
			height: 90rpx;
			line-height: 90rpx;
			background: $pss-color-primary_1;
			margin:30rpx 20rpx 10px;
			border-radius: 50rpx;
			text-align: center;
			color: #fff;
			font-size: 30rpx;
		}
	}
</style>